/**
 * @file main2.cpp
 * @author luxian (you@domain.com)
 * @brief 这里是Winpcap 的实例代码 （已废弃）
 * @version 0.1
 * @date 2022-03-02
 * 
 * @copyright Copyright (c) 2022
 * 
 */
#include <iostream>
#include <cstdio>
#include <cstdlib>
// #include<stdio.h>
// #include<stdlib.h>
//#define u_int unsigned int
//#define u_short unsigned short
//#define u_char unsigned char

#define HAVE_REMOTE

#include "pcap.h"
#include "remote-ext.h"

#pragma comment(lib, "wpcap.lib")

// #include"winpcap/pcap.h"

typedef unsigned int u_int;
typedef unsigned short u_short;
typedef unsigned char u_char;

using namespace std;
int main()
{
    pcap_if_t *alldevs, *d;
    int i = 0;
    char errbuf[PCAP_ERRBUF_SIZE];
    if (pcap_findalldevs(&alldevs, errbuf) == -1)
    {
        fprintf(stderr, "Error in pcap_findalldevs: %s\n", errbuf);
        exit(1);
    }
    for (d = alldevs; d; d = d->next)
    {
        printf("%d. %s", ++i, d->name);
        if (d->description)
            printf(" (%s)\n", d->description);
        else
            printf(" (No description available)\n");
    }
    if (i == 0)
    {
        printf("\nNo interfaces found! \n");
        return 0;
    }
    //pcap_freealldevs(alldevs);
    //getchar();

    d = alldevs;
    pcap_t * pcap_Temp = pcap_open_live(d->name,65535,1,1000,errbuf);









}